home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
ab20
/
ab20_archive
/
games
/
action
/
megaball-2.0.lzh
/
STV.docs
< prev
next >
Wrap
Text File
|
1980-01-01
|
10KB
|
267 lines
***************************************
* *
* STV - Simple Text Viewer v1.00 *
* © Copyright 1990 by Timm Martin *
* *
***************************************
This program is freeware. It may be distributed alone or in conjunction with
any program, commercial or otherwise, with no compensation to the author.
******************
* INTRODUCTION *
******************
As the name implies, STV is a very simple text viewer. It does not:
-- display ANSI codes
-- use blitter text for high-speed scrolling
-- have word wrap or scroll horizontally
However, STV:
-- has word search
-- has the ability to read multiple documents
-- runs from an icon (Workbench)
-- runs on the Workbench or ANY custom screen
-- allows you to specify its position and size
-- accommodates both mouse and keyboard input
-- works great with Workbench v2.0 (and v1.3) and all custom fonts
The main purpose of this program is to display program docs and README files.
Because you can specify the window specifications in the icon's ToolTypes,
STV is perfect for PD and computer club disks. STV also has a programming
hook that allows you to call it from within your program and use it as a file
viewer.
****************
* PARAMETERS *
****************
You can specify five parameters when running STV:
LeftEdge
The left edge of the STV window. This is relative to the screen in which
it will appear. The default is 0.
TopEdge
The top edge of the STV window. This is relative to the screen in which
it will appear. The default is 2. This gives you access to the screen's
depth gadgets.
Width
The width of the STV window in pixels. The default is the maximum width
of the screen.
Height
The height of the STV window in pixels. The default is the maximum
height of the screen.
Screen
The DECIMAL address of the screen in which STV will appear. CAUTION!
STV does not verify that this address is valid. If you specify an
invalid address, the system will likely crash. If no screen address is
provided, STV will open its window on the Workbench screen.
STV will not allow you to specify an invalid LeftEdge, TopEdge, Width, or
Height. It will try to accommodate your specifications as best as possible.
*************************
* TO RUN FROM THE CLI *
*************************
To run STV from the CLI, type:
STV [parameters] file1 [file2...]
where the parameters are:
-h<number> ... Height
-l<number> ... LeftEdge
-t<number> ... TopEdge
-w<number> ... Width
-!<number> ... Screen
The parameter characters h,l,t,w may be either upper or lower case. The
parameters must be preceeded by a hyphen so that STV knows they are not file
names. Each parameter must be followed by the corresponding number.
Embedded blanks are not permitted.
Note that you can specify more than one file name. If the desired file is
not in the current directory, be sure to specify its complete path as well.
File names with embedded blanks should be enclosed in quotes.
Parameters and file names may be mixed up in any order.
For example:
stv s:shell-startup -h120 -L45 -!237890 -T16 -w400 readme
will open a 400 x 120 pixel STV window at location 45,16 in the custom screen
whose address is decimal 237890 and load the "shell-startup" file in the s:
directory and the "readme" file in the current directory,
***************************
* TO RUN FROM WORKBENCH *
***************************
Create a project icon for the text files you want to read (you can copy the
icon used for this file if you like). Click on the icon once to highlight
it. Select "Info" from the Workbench menu. Enter the name "STV" in the
"Default Tool" field. If you place STV in a different directory such as c:,
be sure to specify the entire path name such as "c:stv".
You can specify the parameters listed above by adding Tool Types. The
following tool types are accepted:
HEIGHT= ... Height
LEFT= ..... LeftEdge
TOP= ...... TopEdge
WIDTH= .... Width
There is no tool type for the Screen. Note that the tool types must be in
capital letters (this restiction has been lifted under WB 2.0) and must be
followed immediately by an equal sign.
As an example, the following tool types:
HEIGHT=80
TOP=100
WIDTH=400
will open a 400 x 80 pixel screen at location 0,100 (0 is the default left
edge as listed above).
To read more than one file at a time from the Workbench, click on all of the
corresponding icons and select "Open" from the Workbench menu. The files will
be loaded in the order you clicked their icons.
***************
* OPERATION *
***************
STV can be operated from the keyboard or with the mouse.
SCROLLING THE DISPLAY
UpArrow key ........... scroll up one line, displaying the previous line
DownArrow key ......... scroll down one line, displaying the next line
Alt-UpArrow key ....... scroll up one page, displaying the previous page
Alt-DownArrow key ..... scroll down one page, displaying the next page
Shift-UpArrow key ..... display beginning of file
Shift-DownArrow key ... display end of file
As with the program "More", the Space Bar will also scroll down one page,
displaying the next page.
You can also scroll the display by clicking the left mouse button on the
slider bar in the right edge of the window. If you click on the bar and
hold down the left mouse button, the display will scroll with the movement
of the mouse. Clicking above the bar will scroll the display up one page;
clicking below the bar will scroll the display down one page.
You can also scroll the display by clicking the left mouse button anywhere
else in the window. Clicking and holding the left mouse button while the
mouse pointer is above the center of the window will cause the display to
scroll up one line at a time. Clicking below the center of the window will
cause the display to scroll down one line at a time. As you move the mouse
closer to the center of the window, the scrolling will slow down. The
farther away from the center the pointer is, the faster the display will
scroll. If you move the pointer to the top or above the window, the
display will begin to page backward. If you move the pointer to the bottom
or below the window, the display will page forward.
FILE SELECTION
STV loads and displays only one file at a time and in the order you
specify them. To display the next file, press the 'N' key or select "Next
File" from the menu. To display the previous file, press the 'P' key or
select "Previous File" from the menu. These menu options will be disabled
(ghosted) if there are no previous or next files to display.
WORD SEARCH
To search for a word in the displayed file, select "Search" from the menu
or press the 'S' key. The prompt "Search for:" and a cursor will appear in
the middle of the STV window. Type up to 20 characters and press RETURN.
The normal Amiga string gadget commands are available here: Right-Amiga-X
to delete the contents, etc. To cancel the search, delete the contents and
press RETURN.
The search is case insensitive, meaning that the search string "program"
will find "Program", "PROGRAM", and "programming". Of course, you can also
include embedded blanks to search for a phrase, such as "C Programming".
STV will always start its search from the beginning of the file and will
search forward. If the string of words you entered is found, STV will
display the string at the top of the window and will highlight the string.
If the string is not found, the display will flash.
To continue searching from the current search position (in other words,
from the point where the last search word was found), select "Search Again"
from the menu or press the 'A', RETURN, or ENTER key.
NOTE: Searching in binary files will not work correctly.
LET ME OUTTA HERE!
To quit the program, select "Quit" from the menu or press the 'Q' or ESCape
key. You don't have to read all of the specified files to quit.
***************************
* TECHNICAL INFORMATION *
***************************
To open the STV window on a custom screen from within a C program, consider
the following example:
/* using these variable definitions */
char buffer[100]; /* a scratch buffer for use with Execute() */
char *file_name; /* contains the name of the file to be displayed */
struct Screen *screen; /* pointer to an opened custom screen */
/* use this code to run STV */
sprintf( buffer, "c:STV -!%ld %s", (long)screen, file_name );
Execute( buffer, NULL, NULL );
See the AmigaDOS docs for more information on how to use the Execute()
command. It's often not quite as simple as listed above. If you want STV to
run asynchronously (in other words, you don't want your program to "sleep"
while STV is running), add the "run" command before "c:STV".
****************
* THE FUTURE *
****************
This program is about as simple as you can get. I suppose someday I may
attempt to write "the ultimate text reader," but right now I really have no
idea just what that would be. Have any suggestions? Then let me know.
********************
* CORRESPONDENCE *
********************
Timm Martin
P.O. Box 10084
Largo, FL 34643
U.S.A.
STV Docs v1.00 09/28/90
© Copyright 1990 Timm Martin
/*-- END --*/